package ui.actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import tree.PageTree;
import util.Util;

/**
 * Action that creates a copy of the current page.
 * @author TKington
 *
 */
public class InsertNodeCopyAction extends AbstractAction {
	/**
	 * Creates a new InsertNodeCopyAction.
	 */
	public InsertNodeCopyAction() {
		putValue(NAME, "CopyPg");
		putValue(SHORT_DESCRIPTION, "Insert Copy of Current Page");
		//putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
		putValue(SMALL_ICON, Util.getIcon("Copy16.gif")); //$NON-NLS-1$
	}
	
	public void actionPerformed(ActionEvent evt) {
		PageTree tree = PageTree.instance();
		tree.insertNodeCopy();
	}
}
